package dataImport.model;

import dataImport.model.abstracts.AbstractEntity;


public class Scenario extends AbstractEntity {

	private static final long serialVersionUID = 5712885940533370934L;

	private State state;

	private Text text;

	private Place placeRelatedTo;

	public Scenario(final String id, final State state, final Text text, final Place placeRelatedTo) {
		super(id);
		this.state = state;
		this.text = text;
		this.placeRelatedTo = placeRelatedTo;
	}

	public State getState() {
		return this.state;
	}

	public void setState(State state) {
		this.state = state;
	}

	public Text getText() {
		return this.text;
	}

	public void setText(Text text) {
		this.text = text;
	}

	public Place getPlaceRelatedTo() {
		return this.placeRelatedTo;
	}

	public void setPlaceRelatedTo(Place placeRelatedTo) {
		this.placeRelatedTo = placeRelatedTo;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = super.hashCode();
		result = prime * result + ((this.placeRelatedTo == null) ? 0 : this.placeRelatedTo.hashCode());
		result = prime * result + ((this.state == null) ? 0 : this.state.hashCode());
		result = prime * result + ((this.text == null) ? 0 : this.text.hashCode());
		return result;
	}

	@Override
	public boolean equals(java.lang.Object obj) {
		if (this == obj) {
			return true;
		}
		if (!super.equals(obj)) {
			return false;
		}
		if (this.getClass() != obj.getClass()) {
			return false;
		}
		Scenario other = (Scenario) obj;
		if (this.placeRelatedTo == null) {
			if (other.placeRelatedTo != null) {
				return false;
			}
		}
		else if (!this.placeRelatedTo.equals(other.placeRelatedTo)) {
			return false;
		}
		if (this.state == null) {
			if (other.state != null) {
				return false;
			}
		}
		else if (!this.state.equals(other.state)) {
			return false;
		}
		if (this.text == null) {
			if (other.text != null) {
				return false;
			}
		}
		else if (!this.text.equals(other.text)) {
			return false;
		}
		return true;
	}

}
